/******************************************************************************
*	configuration.h
*	 by Alex Chadwick
*
*	A light weight implementation of the USB protocol stack fit for a simple
*	driver.
*
*	configuration.h contains definitions for all optional components
*	The makefile defines three main categories of definitions:
*		CONFIG: Whether or not this is a DEBUG driver
*		TARGET: The target system
*		TYPE:	What sort of driver to compile (e.g. standalone)
*****************************************************************************/
#ifndef _CONFIGURATION_H
#define _CONFIGURATION_H

//------------------------------------------------------------------------------
// Build config is specified by CONFIG and is suuplied via the makefile with:
//   make driver CONFIG=FINAL|DEBUG .. default: FINAL
//
#if   defined CONFIG_DEBUG

#elif defined CONFIG_FINAL

#elif defined CONFIG_ERROR
#	error Please specify CONFIG=FINAL|DEBUG .. Eg. make CONFIG=FINAL (default)

#else
#	error Please use the provided makefile to compile the driver

#endif

//------------------------------------------------------------------------------
// TARGET architecture is supplied via the makefile with:
//   make driver TARGET=RPI|NONE .. default: RPI
//
#if defined TARGET_RPI        // Compiling for the Raspberry Pi (model B).
#	define ARM                // This is an ARM1176JZF-S
#	define ARM_V6             // ...running ARMv6.
#	define ENDIAN_LITTLE      // ...in little-endian mode
#	define BROADCOM_2835      // The chip is a Broadcom 2835
#	define HCD_DESIGNWARE_20  // ...with a Designware OTG Core
#	define HCD_DESIGNWARE_BASE ((void*)0x20980000)  // Mapped to physical address 0x20980000

#elif defined TARGET_NONE
#	error This source will not (currently) compile for TARGET=NONE

#elif defined TARGET_ERROR
#	error Please specify TARGET=RPI|NONE .. Eg. make TARGET=RPI (default)

#else
#	error Please use the provided makefile to compile the driver

#endif

//------------------------------------------------------------------------------
// Build TYPE is supplied via the makefile with:
//   make driver TYPE=LOWLEVEL|STANDALONE|DRIVER .. default: LOWLEVEL
//
#if defined TYPE_STANDALONE
#	define NO_LOG                // Disables all logging
#	define MEM_INTERNAL_MANAGER  // Disables external memory management
#	define MEM_NO_RESERVE        // Disables external memory reservation

#elif defined TYPE_LOWLEVEL
#	define MEM_INTERNAL_MANAGER  // Disables external memory management
#	define MEM_NO_RESERVE        // Disables external memory reservation

#elif defined TYPE_DRIVER

#elif defined TYPE_ERROR
#	error Please specify TARGET=LOWLEVEL|STANDALONE|DRIVER .. Eg. make TARGET=LOWLEVEL (default)

#else
#	error Please use the provided makefile to compile the driver

#endif

#endif // _CONFIGURATION_H
